home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group97b.txt
/
000005_icon-group-sender _Sat Jun 28 07:13:53 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 30 Jun 1997 08:22:22 MST
Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM)
id AA19571; Mon, 30 Jun 1997 08:22:22 -0700
Posted-Date: Sat, 28 Jun 1997 07:13:53 -0500 (CDT)
Date: Sat, 28 Jun 1997 07:13:53 -0500 (CDT)
From: Chris Tenaglia <cdt@post.its.mcw.edu>
To: icon-group@cs.arizona.edu
Subject: kbhit & getch
Message-Id: <Pine.SOL.3.96.970628070116.6031A-100000@post.its.mcw.edu>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
I wrote a game in icon and it worked well under DEC Ultrix.
But it broke when we migrated to solaris. Here's the heart
of the game loop:
repeat
{
draw_screen() # draw the screen and score fields
animate() # draw/undraw the sprites
sense() # sense for shooting (keyboard keys)
}
...
procedure sense()
kbhit() | fail
struck := getch()
...
end
In the past :
No Strike : kbhit would fail, then fail out of the procedure
On Strike : the keyboard would be polled and the key would be
sampled and processing would continue. The getch seemed to
turn off the kbhit trap and it would go to No Strike mode again.
On the solaris system, it seems that once kbhit is tripped it
stays tripped, never fails, and keeps getting stuck on the getch.
Is there a different or better way of keyboard sampling or maybe
a way to restore the prior behavior? Thanx in advance.
Chris Tenaglia (system manager) | The future foretold,
Medical College of Wisconsin | The past explained,
8701 W. Watertown Plank Rd. | The present largely appologized for.
Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor